home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
comm
/
misc
/
dcdd_v2_4.lha
/
Do_CRIS.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-10-03
|
10KB
|
406 lines
/*
Do_CRIS.rexx Version 1.3 941003.1932
This was written so that I could keep an eye on the "latest news" about
the Amiga buyout (whenever it gets here!) The AUTO mode is setup for this.
*/
address BAUD /* must have this here */
OPTIONS RESULTS
parse arg N_args
parse var N_args PW1 PW2 Xargs
auto = 'X'
test = 'X'
waitlost = ' '
/* below will stop the updating of the .newsrc file or DLing of news files */
if exists('ram:CRIS_TEST')~=0 then
test = 'y'
if exists('ram:AUTO')~=0 then
auto = 'y'
call LOGON
/* below allows the UPloading of RAM:.newsrc into your CRIS account to allow
for selecting a batch of new news groups and will then download this file
after it has been updated. (Magic Token act!) when both Crisinet.qwk and
.newsrc files have been downloaded they are renamed using date and time */
if auto = 'y' then do
if waitlost = 'n' then
call AUTO_IGQWK
end
/* below allows you to use the AUTO mode and then change your mind and stay
connected. It's very usefull to be able to change your mind............ */
if exists('ram:SIT_STAY')=0 then do
if auto = 'y' then do
if waitlost = 'n' then
call LOGOFF
end
end
if auto = 'y' then do
if waitlost = 'n' then
call CLEANUP
end
/* below gets you out of any process that has had problems */
if waitlost ~= 'n' then do
if exists('RAM:continue')~=0 then do
address command 'delete RAM:continue'
exit
end
end
return
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Functions / Subroutines *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
LOGON:
address BAUD /* must have this here */
send '\w\w\w\w\w\w\w'
send '@D'
send '\w\r'
waitlost = ' '
waitlost_LO_hold = ' '
PW_loop_count = 0
Q2QUIT_loop_count = 0
do forever
nput='TERMINAL=,@,CRIS CONNECTED,Otherwise type,Enter your password:,or Q to QUIT,or X to EXIT,NO CARRIER'
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 30 seconds & no nput items on serial port */
waitlost = 'y'
msg '****** LOGON - wait is LOST! ******'
Capture OFF
leave
end
if NRESULT = 'TERMINAL=' then
send '\r'
if NRESULT = '@ ' then do
if exists('RAM:continue')~=0 then do
send 'C CRIS'
send '\r'
end
end
if NRESULT = 'CRIS CONNECTED' then
call time(R)
if NRESULT = 'Otherwise type' then
send 'jws\r'
if NRESULT = 'Enter your password:' then do
PW_loop_count = PW_loop_count + 1
if PW_loop_count = 1 then
send PW1'\w\r'
if PW_loop_count = 2 then do
if exists('DH1:-dl/CRIS_PW2_used')=0 then
address command 'makedir DH1:-dl/CRIS_PW2_used'
send PW2'\w\r'
end
if PW_loop_count > 2 then do
waitlost = 'y'
msg '****** Logon PW_loop_count > 2 ******'
Capture OFF
leave
end
end
if NRESULT = 'or Q to QUIT' then do
send '\r'
waitlost = 'n'
end
if NRESULT = 'or X to EXIT' then do
waitlost = 'n'
send '\w\w'
send 'X'
end
if NRESULT = 'NO CARRIER' then do /* if logon really gets */
waitlost = 'y' /* LOST */
leave /* this will get you OUT */
end
if waitlost ~= ' ' then do
send '\w\w'
leave
end
end
return
AUTO_IGQWK:
OPTIONS RESULTS
address command
address BAUD /* must have this here */
waitlost = ' '
PSO_loop_count = 0
SAO_loop_count = 0
CI_loop_count = 0
SELECT_loop_count = 0
Q2QUIT_loop_count = 0
DONE_ONCE = 'n'
send '\w\w'
send '3'
send '\r'
do forever
nput='Please Select an Option:,Select An Option Or,S-INET, Select (1,Enter choice,(y/n),or Q to QUIT,Dialing aborted!'
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 30 seconds & no nput items on serial port */
waitlost = 'y'
msg '****** AUTO_IGQWK - wait is LOST! ******'
Capture OFF
leave
end
if NRESULT = 'Dialing aborted!' then do
waitlost = 'y'
msg '****** AUTO_IGQWK - Dialing aborted ******'
Capture OFF
leave
end
if NRESULT = 'Select An Option Or' then do
SAO_loop_count = SAO_loop_count + 1
if SAO_loop_count = 1 then do
send '\w\w'
send '8'
send '\r'
end
if SAO_loop_count = 2 then do
waitlost = 'n'
send '\w\w'
send 'x'
send '\r'
end
if SAO_loop_count > 2 then do
waitlost = 'y'
msg '****** AUTO_IGQWK - SAO_loop_count > 2 ******'
Capture OFF
leave
end
end
if NRESULT = 'S-INET' then do
if CI_loop_count = 0 then do
if exists('ram:.newsrc')~=0 then do
if DONE_ONCE = 'n' then do
address command 'copy RAM:.newsrc RAM:-dl/.newsrc'
send '\w\w\w\w'
send 'rz -b -w 2048'
send '\r'
send '\w\w'
send '\au-.newsrc'
send '\w\w'
DONE_ONCE = 'y'
if exists('RAM:-dl/.newsrc')~=0 then do
address command 'delete RAM:-dl/.newsrc'
end
end
end
send '\w\w'
send '\r'
end
CI_loop_count = CI_loop_count + 1
if CI_loop_count = 1 then do
send '\w\w'
send 'igqwk'
send '\r'
end
if CI_loop_count = 2 then do
send '\w\w'
send 'sz -b -w 2048 .newsrc'
send '\r'
send '\w\w\w\w\w\w'
end
if CI_loop_count = 3 then do
send '\w\w'
send 'x'
send '\r'
end
call delay(1)
if CI_loop_count > 4 then do
waitlost = 'y'
msg '****** AUTO_IGQWK - CI_loop_count > 4 ******'
Capture OFF
leave
end
end
if NRESULT = ' Select (1' then do
SELECT_loop_count = SELECT_loop_count + 1
if SELECT_loop_count = 1 then do
send '\w\w'
send '1'
send '\r'
end
if SELECT_loop_count = 2 then do
send '\w\w'
send '2'
send '\r'
end
if SELECT_loop_count > 2 then do
waitlost = 'y'
msg '****** AUTO_IGQWK - SELECT_loop_count > 2 ******'
Capture OFF
leave
end
end
if NRESULT = 'or Q to QUIT' then do
Q2QUIT_loop_count = Q2QUIT_loop_count + 1
if Q2QUIT_loop_count = 1 then do
send '\w\w'
send '\r'
end
if Q2QUIT_loop_count = 2 then do
send '\w\w'
send '\r'
end
if Q2QUIT_loop_count > 2 then do
waitlost = 'y'
msg '****** AUTO_IGQWK - Q2QUIT_loop_count > 2 ******'
Capture OFF
leave
end
end
if NRESULT = 'Enter choice' then do
if test = 'y'then do
send '\w\w'
send '1'
send '\r'
end
if test ~= 'y' then do
send '\w\w'
send '2'
send '\r'
end
end
if NRESULT = '(y/n)' then do
if test = 'y' then do
send '\w\w'
send 'n'
send '\r'
end
if test ~= 'y' then do
send '\w\w'
send 'y'
send '\r'
end
end
if waitlost ~= ' ' then
leave
end
return
LOGOFF:
address BAUD /* must have this here */
OPTIONS RESULTS
address command
address BAUD /* must have this here */
waitlost = ' '
do forever
nput='Please Select an Option:,or R to re-logon)?,@'
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 30 seconds & no nput items on serial port */
waitlost = 'y'
msg '****** AUTO_LOGOFF - wait is LOST! ******'
Capture OFF
leave
end
if NRESULT = 'Please Select an Option:' then do
send '\w\w'
send 'g'
send '\r'
end
if NRESULT = 'or R to re-logon)?' then do
send '\w\w'
send 'y'
send '\r'
end
if NRESULT = '@' then do
waitlost = 'n'
send '\w\w'
send 'hang'
send '\r'
end
if waitlost ~= ' ' then
leave
end
return
CLEANUP:
OPTIONS RESULTS
address command
dateYYMMDD=right(date(sorted),6)
timea=translate(time(n),' ',':')
parse value timea with timeHH timeMM timeSS .
timeHHMMSS=timeHH||timeMM||timeSS
if exists('RAM:-dl/crisinet.qwk')~=0 then do
/*
address command 'rename RAM:-dl/crisinet.qwk RAM:-dl/crisinet.qwk.'dateYYMMDD'.'timeHHMM
************************************************************************
can anyone tell me why the above line will not work, while the next
two will, please let me know. I'm stumped!
************************************************************************
*/
address command 'copy RAM:-dl/crisinet.qwk RAM:-dl/crisinet.qwk.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/crisinet.qwk'
end
if exists('RAM:-dl/.newsrc')~=0 then do
address command 'copy RAM:-dl/.newsrc RAM:-dl/crisinet.tkn.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/.newsrc'
end
if exists('RAM:.newsrc')~=0 then do
address command 'copy RAM:.newsrc RAM:UL_newsrc.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:.newsrc'
end
if exists('RAM:SIT_STAY')~=0 then
address command 'delete RAM:SIT_STAY'
return